package com.biocar.service.impl;

import com.biocar.bean.Approve;
import com.biocar.mapper.ApproveMapper;
import com.biocar.service.ApproveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.NoSuchElementException;

/**
 * @author quxiang
 * @date 2021/12/15 10:52
 */
@Service
public class ApproveServiceImpl implements ApproveService {

    @Autowired
    private ApproveMapper approveMapper;

    @Override
    public List<Approve> getApproveSort(int id) throws NoSuchElementException {
       List<Approve> list=approveMapper.getApproveSort(id);
       if(list==null)
           throw new NoSuchElementException();

        return list;
    }

    @Override
    public boolean isApproveById(int id, int chargeId) {
        if(approveMapper.isApproveBySort(id,chargeId)==null)
        {
            return false;
        }
        return true;
    }


}
